package com.fly.controller;

import com.fly.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    //属性注入
//    @Autowired
    private UserService userService;
    //构造方法注入
    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }
    //Setter注入
    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }
    @RequestMapping("/add")
    public void add(String username, String password) {
//        userService.save(new UserPo(username, password));
    }
}
